package com.lhb.test.controller;

import com.lhb.test.rabbitmqTest.PublishDemo;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class PubRest {

    @Autowired
    private PublishDemo publishDemo;

    public static void main(String[] args) {
        PubRest pubRest = new PubRest();
        pubRest.publish("lll");
    }

    @GetMapping(path = {"","/","/publish"})
    public String publish(String name)
    {
        return publishDemo.publish2mq(name);
    }
}
